<template>
  <view class="page">
    <fu-custom :isBack="true" :isBottom="true" bgColor="bg-white">
			<view slot="content">{{i18n["修改密码"]}}</view>
		</fu-custom>
    <view class="fu-fs28">
      <!-- 旧密码验证修改 start -->
      <view class="padding-lr bg-white" v-if="isHavePassword" @tap="handleJump"  data-url="/pages/index/setting/change-password/index">
        <view class="flex align-center justify-between padding-tb solid-bottom">
          <text class="fu-fs32 text-333">{{i18n['旧密码验证修改']}}</text>
          <text class="cuIcon-right"></text>
        </view>
      </view>
      <!-- 旧密码验证修改 end -->
      <!-- 手机号码验证修改 start -->
      <view class="padding-lr bg-white" @click="handleRoute">
        <view class="flex align-center justify-between padding-tb solid-bottom">
          <text class="fu-fs32 text-333">{{i18n['手机号验证修改']}}</text>
          <text class="cuIcon-right"></text>
        </view>
      </view>
      <!-- 手机号码验证修改 end -->
    </view>

    <!-- 断网监测 start -->
    <fu-notwork></fu-notwork>
    <!-- 断网监测 end -->
  </view>
</template>

<script>
  export default {
    data() {
      return {
        isHavePassword: false,
      };
    },
    onShow() {
      this.postloginIsHavePassword()
    },
    onLoad() {
      this.setNavigationBarTitle(this.i18n['修改密码']);
    },
    methods: {
      // 0 没有设置过密码 1 有设置密码
      postloginIsHavePassword() {
        this.$api.post(global.apiUrls.postloginIsHavePassword).then(res => {
          if(res.data.code == 1){
            this.isHavePassword =  res.data.data.is_password
          }
        })
        .catch(err => {
          console.log(err);
        });
      },
      handleRoute(){
        this.$urouter.navigateTo({
          url: '/pages/index/setting/modify-password-verify-phone/index',
          params: {
            type: 2,
          }
        });
      },

    }
  };
</script>

<style lang="scss" scoped>
</style>
